/*
package cn.ok.quartzdemo.config;

import com.alibaba.druid.pool.DruidDataSource;//druid-1.1.5.jar
import javax.sql.DataSource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

*/
/**
 * //import org.springframework.context.annotation.Primary;相比gbase的少了这个，应该是主数据源的意思。下面的方法还少了@Primary注解。
 * @author wxming.
 * @date 2018/2/9.
 *//*

@Configuration
@MapperScan(basePackages = GBaseDataSourceConfigJiu.PACKAGE,sqlSessionFactoryRef = "gbaseSqlSessionFactory")
public class GBaseDataSourceConfigJiu {
    static final String PACKAGE ="cn.gov.cus.rmftras.mappers.gbase";

    @Value("${datasource.gbase.url}")
    private String url;
    @Value("${datasource.gbase.username}")
    private String user;
    @Value("${datasource.gbase.password}")
    private String password;
    @Value("${datasource.gbase.driver-class-name}")
    private String driverClassName;

    @Bean(name = "gbaseDataSource")
    public DataSource gbaseDataSource(){
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setDriverClassName(driverClassName);
        dataSource.setUrl(url);
        dataSource.setUsername(user);
        dataSource.setPassword(password);

        return dataSource;
    }

    @Bean(name = "gbaseTransactionManager")
    public DataSourceTransactionManager gbaseTransactionManager(){
        return new DataSourceTransactionManager(gbaseDataSource());
    }

    @Bean(name = "gbaseSqlSessionFactory")
    public SqlSessionFactory gbaseSqlSessionFactory(@Qualifier("gbaseDataSource") DataSource gbaseDataSource) throws Exception{
        final SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();

        org.apache.ibatis.session.Configuration config = new org.apache.ibatis.session.Configuration();
        config.setMapUnderscoreToCamelCase(false);//特殊需求，Gbase数据库的po类字段映射没有按驼峰命名来，而是直接和数据库里的一样全是大写，且带下划线。
        sessionFactoryBean.setConfiguration(config);

        sessionFactoryBean.setDataSource(gbaseDataSource);
        return sessionFactoryBean.getObject();
    }

}


*/
